<div class="bg-light lter b-b wrapper-md ng-scope">
    <h4 class="m-n font-thin">添加微信配置</h4>
    <!--<button ui-sref="app.wechatConfig" class="btn-back btn btn-dark btn-sm btn-rounded">-->
        <!--返回-->
    <!--</button>-->
</div>
<div class="wrapper-md" ng-controller="wechatConfigAddCtrl">
    <div class="panel panel-default">
        <div class="panel-heading m-n">
            添加微信配置
        </div>
        <div class="panel-body">
            <form name="wechatInfo" class="form-horizontal" method="POST" ng-submit="wechatConfigAdd()">

                <div class="form-group">
                    <label class="col-sm-2 control-label">店铺类型</label>
                    <div class="col-sm-5">
                        <div class="m-b-sm m-r-xs inline">
                            <div class="radio inline m-r-n">
                                <label class="i-checks i-checks-sm">
                                    <input type="radio" ng-model="wechat.isChain" value="0">
                                    <i></i>
                                </label>
                            </div>
                            <p class="inline m-n">单店</p>
                        </div>
                        <div class="m-b-sm inline">
                            <div class="radio inline m-r-n">
                                <label class="i-checks i-checks-sm">
                                    <input type="radio" ng-model="wechat.isChain" value="1">
                                    <i></i>
                                </label>
                            </div>
                            <p class="inline m-n">连锁品牌</p>
                        </div>
                  <!--      <div class="m-b-sm inline">
                            <div class="radio inline m-r-n">
                                <label class="i-checks i-checks-sm">
                                    <input type="radio" ng-model="wechat.csId" value="root">
                                    <i></i>
                                </label>
                            </div>
                            <p class="inline m-n">乐鸽</p>
                        </div>-->
                    </div>
                </div>

                <div class="form-group" ng-if="wechat.isChain == 0">
                    <label class="col-sm-2 control-label">店铺名称</label>
                    <div class="col-sm-5">
                        <select name="shopName" class="form-control" ng-model="wechat.csId" required>
                            <option value="">请选择店铺名称</option>
                            <option value="{{s.id}}"  ng-repeat="s in data">{{s.name}}</option>
                        </select>
                    </div>
                   <!-- <div class="form-text " ng-if="wechatInfo.shopName.$touched">
                        <span class="text-danger" ng-if="wechatInfo.shopName.$error.required">(请您选择店铺)</span>
                    </div>-->
                </div>

                <div class="form-group" ng-if="wechat.isChain == 1">
                    <label class="col-sm-2 control-label">连锁品牌名称</label>
                    <div class="col-sm-5">
                        <select name="shopName" class="form-control" ng-model="wechat.csId" required>
                            <option value="">请选择连锁品牌名称</option>
                            <option value="{{c.id}}"  ng-repeat="c in chainData">{{c.name}}</option>
                        </select>
                    </div>
                   <!-- <div class="form-text " ng-if="wechatInfo.shopName.$touched">
                        <span class="text-danger" ng-if="wechatInfo.shopName.$error.required">(请您选择店铺)</span>
                    </div>-->
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">AppID</label>
                    <div class="col-sm-5">
                        <input type="text" ng-model="wechat.appId" class="form-control" name="AppId" placeholder="请输入AppID" required>
                    </div>
                    <div class="form-text " ng-if="wechatInfo.AppId.$touched">
                        <span class="text-danger" ng-if="wechatInfo.AppId.$error.required">(请您输入AppID)</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">Secret</label>
                    <div class="col-sm-5">
                        <input type="text" ng-model="wechat.secret" class="form-control" name="Secret" placeholder="请输入Secret" required>
                    </div>
                    <div class="form-text" ng-if="wechatInfo.Secret.$touched">
                        <span class="text-danger" ng-if="wechatInfo.Secret.$error.required">(请您输入Secret)</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">Partner</label>
                    <div class="col-sm-5">
                        <input type="text" ng-model="wechat.partner"  class="form-control" name="Partner" placeholder="请输入Partner" required>
                    </div>
                    <div class="form-text" ng-if="wechatInfo.Partner.$touched">
                        <span class="text-danger" ng-if="wechatInfo.Partner.$error.required">(请您输入Partner)</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">Secret For Pay</label>
                    <div class="col-sm-5">
                        <input type="text" ng-model="wechat.paySecret" class="form-control" name="SecretForPay" placeholder="请输入Secret For Pay" required>
                    </div>
                    <div class="form-text" ng-if="wechatInfo.SecretForPay.$touched">
                        <span class="text-danger" ng-if="wechatInfo.SecretForPay.$error.required">(请您输入Secret For Pay)</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">Is System Config</label>
                    <div class="col-sm-5">
                        <label class="i-switch m-t-xs m-r">
                            <input type="checkbox" ng-checked="wechat.isSys==1" ng-init="wechat.isSys=0" ng-click="wechat.isSys=wechat.isSys==1?0:1;">
                            <i></i>
                        </label>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
               <div class="form-group ">
                    <div class="col-sm-4 col-sm-offset-2">
                        <button type="submit" class="btn btn-success" ng-disabled="wechatInfo.$invalid">保存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>




